#ifndef VM_FUNC_HPP__
#define VM_FUNC_HPP__

/** \file vm_func.hpp
    defines vm-specfic functions that can be called as
    remote procedure calls
*/

#include <vector>

using std::vector;

namespace BMD
{
  class Value;

  //! typedef describing the values for a VM function
  typedef Value (*VMFunction)(vector<Value>&);

  //! transforms a value into a string representation
  Value to_string(vector<Value>& args);

  //! parse values from a string
  Value parse_int(vector<Value>& args);
  Value parse_float(vector<Value>& args);

  //! returns the length of the argument
  Value value_length(vector<Value>& args);
  Value string_length(vector<Value>& args);
  Value array_length(vector<Value>& args);

  //! returns a random float between zero and 1
  Value random_float(vector<Value>& args);

  //! print a value to stdout
  Value print(vector<Value>& args);
  Value println(vector<Value>& args);

  //! print a value to stderr
  Value print_error(vector<Value>& args);
}

#endif
